package com.wang.mall.controller;

import com.wang.mall.model.R;
import com.wang.mall.service.ProductService;
import com.wang.mall.util.PageUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/product")
public class ProductController {

    @Autowired
    private ProductService productService;

    @GetMapping("/getData")
    public R<PageUtils> getData(Integer page, Integer limit) {
        PageUtils pageUtils = productService.queryPage(page, limit);
        return R.ok(pageUtils);
    }

}
